package com.liaoye.hellocustomview.evaluator;

import android.animation.TypeEvaluator;

/**
 * 泛型要和ValueAnimator.ofXXX对称
 * ValueAnimator.ofFloat 对应 Float
 * ValueAnimator.ofInt 对应 Int
 *
 */
public class MyEvaluator implements TypeEvaluator<Float> {

    @Override
    public Float evaluate(float fraction, Float startValue, Float endValue) {
        return startValue + (endValue - startValue) * (1 - fraction);
    }
}
